package com.jvtd.eyl.widget.provider;

import android.graphics.Color;
import android.support.v4.content.ContextCompat;
import android.util.Log;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.Toast;

import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.jvtd.eyl.R;
import com.jvtd.eyl.bean.ui.HomeBean;
import com.jvtd.eyl.widget.adapter.HomeAdapter;
import com.jvtd.utils.ColorUtils;
import com.jvtd.utils.UiUtils;
import com.jvtd.utils.glide.GlideUtils;
import com.jvtd.widget.imageView.JvtdRcImageView;
import com.sxu.shadowdrawable.ShadowDrawable;

/**
 * 分类-供应商
 *
 * 作者:chenlei
 * 时间:2018/11/12 4:45 PM
 */
public class ClassProvider extends BaseItemProvider<HomeBean, BaseViewHolder> {
    @Override
    public int viewType() {
        return HomeAdapter.ADAPTER_TYPE_CLASS;
    }

    @Override
    public int layout() {
        return R.layout.adapter_class;
    }

    @Override
    public void convert(BaseViewHolder helper, HomeBean data, int position) {
        helper.setText(R.id.tv_title,data.getClassBean().getName());
        ImageView imageView = helper.getView(R.id.iv_icon);
//        FrameLayout frameLayout = helper.getView(R.id.fl_shadow);
//        ShadowDrawable.setShadowDrawable(frameLayout,UiUtils.dp2px(mContext,10), ContextCompat.getColor(mContext,R.color.color_shadow), UiUtils.dp2px(mContext,6), 0, 0);
        GlideUtils.showImage(mContext,data.getClassBean().getImg(),imageView,R.drawable.icon_placeholder,GlideUtils.CENTER_CROP);
    }
}
